#ifndef CAMERA_H
#define CAMERA_H

#include "ray.h"
#include "matrix.h"
#include "transformation.h"

class Camera{
	public:
		Camera();
		Camera(unsigned int, unsigned int, double);
		Camera(const Vector3D&, const Vector3D&, const Vector3D&, unsigned int, unsigned int, double);
		~Camera();

		const Vector3D &getEye() const {return eye;};
		const Vector3D &getLookAt() const {return lookAt;};
		const Vector3D &getUp() const {return up;};
		unsigned int getM() const {return m;};
		unsigned int getN() const {return n;};
		double getFocalDistance() const {return f;};
		Transformation getTransformation() const {return transform;};

		void setEye(const Vector3D &_eye) {eye = _eye;};
		void setLookAt(const Vector3D &_lookAt) {lookAt = _lookAt;};
		void setUp(const Vector3D &_up) {up = _up;};
		void setM(unsigned int _m) {m = _m;};
		void setN(unsigned int _n) {n = _n;};
		void setFocalDistance(double _f) {f = _f;};

		Ray getRay(unsigned int, unsigned int);

		void draw() const;

	private:
		Vector3D eye;//onde a camera se encontra
		Vector3D lookAt;//para onde ela está olhando (asism se tem o eixo central)
		Vector3D up;//o vetor cim
		/*com esses três valores é possivel descobrir os eixos i, j, k da camera*/

		unsigned int m, n;
		double f, discretization;
		//m = tamanho horizontal - só pode ser impar
		//n = tamanho vertical - só pode ser impar
		//f = distancia focal - quanto maisor for, mais discretizado ficará

        Transformation transform;

		void getLocalCoordinates(Vector3D *, Vector3D *, Vector3D *) const;
		void setMatrices();
};

#endif
